
#ifndef  _MYMATH_H
#define  _MYMATH_H


extern u8 fnHexToBcd_u8(u8 Dat);
extern u16 fnHexToBcd_u16(u16 Dat);
extern u32 fnHexToBcd_u32(u32 Dat);


extern u8 fnBcdToHex_u8(u8 Dat);
extern	u16 fnBcdToHex_u16(u16 Dat);
extern 	u32 fnBcdToHex_u32(u32 Dat);

extern u8 fnBcdAdd_u8(u8 Augend,u8 Addend);
extern u8	fnSum(u8 *Dat , u16 Len);
extern u8 fnWeek_Calculate(u8 Year , u8 Month , u8 Day);

extern u32 fnBcdSub_u32(u32 Reduced ,u32 Minuend);

extern u8	fnJudge_Zero(void *Dat , u32 Len);

extern u8 fnCrc_Check(u8 byDir , u8 *pStartPos, u16 nCheckLen , u8 *Crc16);

extern s8 fnDFCmp_DF20(sDF20 *Dat1, sDF20 *Dat2);
extern s8 fnDFCmp_DF15(sDF15 *Dat1, sDF15 *Dat2);

extern s32 fnTwoDateApart_DayCount(sDF20 *Date1 , sDF20 *Date2);
extern s32 fnTwoDateApart_MinuteCount(sDF15 *Date1 , sDF15 *Date2);

extern u32 fnBcdAdd_u32(u32 Augend,u32 Addend);
extern sDF10 fnDFInc_DF10(sDF10 Dat);
extern void	fnDFGet_DF34(sDF34 *Dst , sDF01 *Src);
extern sDF15 fnDFGet_DF15(sDF01 *Time);

extern sDF09	fnDFConver_Hex32ToDF09(u32 Dat);

extern u32 fn32mul32div( u32 DataA, u32 DataB, u16 DataC, u16 DataD);
extern u16 fnDFConver_Bcd16To16(s16 Dat);
extern u32 fnDFConver_Bcd32To32(s32 Dat);
extern	sDF07 fnDFConver_Bcd16ToDF07(u16 Dat);
extern	sDF25 fnDFConver_Bcd32ToDF25(u32 Dat);
extern	sDF05 fnDFConver_Bcd16ToDF05(u16 Dat);
extern	sDF33	fnDFConver_Bcd16ToDF33(u16 Dat);
extern	sDF09	fnDFConver_Bcd32ToDF09(u32 Dat);
extern	void fnBcdSub_Bytes(u8 *Dst , u8 *Src , u8 Len);
extern	void fnBcdAdd_Bytes(u8 *Dst , u8 *Src , u8 Len);
extern  s8	fnBytesCmp_sDF12(u8 *Dat1, u8 *Dat2 , u8 Len);
extern	u8  fnCheckTime_DF01(sDF01 *Dat1);
extern	u8	fnGetBlurDay(u8 SMonth);
extern	void fnHourDec(sDF15 *Date1);
extern	sDF15 fnDFAdd_DF15(sDF15 *Time , u32 IncMin);
extern	u8	 fnGetDay(u8 SMonth , u8 SYear);
#endif	//_MYMATH_H


